package day04;

import java.util.Scanner;

/**
 * 说明:
 *
 * @author: luohaowei
 * @date:2023/2/15
 **/
public class zy {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.println("请选择功能:1.存款 2.取款 3.转账 4.退出");
        int comman = scan.nextInt();
        switch (comman) {
            case 1:
                System.out.println("存款业务...");
                break;
            case 2:
                System.out.println("取款业务...");
                break;
            case 3:
                System.out.println("转账业务...");
                break;
            case 4:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("输入错误");
        }
        /*
        Scanner scan2 = new Scanner(System.in);
        System.out.println("请选择功能:1.存款服务 2.取款服务 3.转账服务 4.退出服务");
        int comman1 = scan2.nextInt();
        switch (comman) {
            case 1:
                System.out.println("存款业务...");
                break;
            case 2:
                System.out.println("取款业务...");
                break;
            case 3:
                System.out.println("转账业务...");
                break;
            case 4:
                System.out.println("退出成功");
                break;
            default:
                System.out.println("输入错误");
        }
        */
        int num = (int) (Math.random() * 1000 + 1);
        int guess;
        do {
            System.out.println("猜吧");
            guess = scan.nextInt();

            if (guess > num) {
                System.out.println("猜大了");
            } else if (guess < num) {
                System.out.println("猜小了");
            } else {
                System.out.println("恭喜你猜对了");
            }
        }while (guess != num) ;
        /*int num = (int) (Math.random() * 1000 + 1);
        int guess;
        do {
            System.out.println("猜吧");
            guess = scan2.nextInt();

            if (guess > num) {
                System.out.println("猜大了");
            } else if (guess < num) {
                System.out.println("猜小了");
            } else {
                System.out.println("恭喜你猜对了");
            }
        }while (guess != num) ;

         */




    }
}
